# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=vba2graph
pkgver=29.fcf96ef
pkgrel=4
pkgdesc='Generate call graphs from VBA code, for easier analysis of malicious documents.'
groups=('blackarch' 'blackarch-malware' 'blackarch-misc')
arch=('any')
url='https://github.com/MalwareCantFly/Vba2Graph'
license=('custom:BSD')
depends=('graphviz' 'python2' 'python2-networkx' 'python2-regex' 'python2-pydot'
         'python2-graphviz' 'python2-setuptools')
makedepends=('git')
source=("$pkgname::git+https://github.com/MalwareCantFly/Vba2Graph.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i 's|#!/usr/bin/env python|#!/usr/bin/env python2|' "$pkgname.py"
}

package() {
  cd $pkgname

  install -Dm 755 "$pkgname.py" "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
}

